<template>
  <div id="content">
    <div class="cinema_menu">
      <div class="city_switch">
        全城 <i class="iconfont icon-lower-triangle"></i>
      </div>
      <div class="brand_swtich">
        品牌 <i class="iconfont icon-lower-triangle"></i>
      </div>
      <div class="feature_switch">
        特色 <i class="iconfont icon-lower-triangle"></i>
      </div>
    </div>

    <div class="cinema_body" ref="cinema_body">
      <ul>
        <li v-for="item in cinemalist" :key="item.id">
          <div>
            <span>{{ item.name }}</span>
            <span class="q"
              ><span class="price">{{ item.price }}</span> 元起</span
            >
          </div>
          <div class="address">
            <span>{{ item.address }}</span>
            <span>{{ item.distance }}</span>
          </div>
          <div class="card">
            <div v-for="value in item.tag" :key="value.id">
              {{ value.name }}
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
import BScroll from "better-scroll";
import { Toast } from "mint-ui";
export default {
  data() {
    return {
      cinemalist: [],
    };
  },
  created() {},
  methods: {
    async getcinema() {
      const res = await this.$axios.get("http://192.168.43.145:3000/cinema");
      if (res.status == 200) {
        this.cinemalist = res.data.cinemalist;
        this.$nextTick(() => {
          new BScroll(this.$refs.cinema_body, {
            scrollbar: true,
          });
        });
      } else {
        Toast("请求失败");
      }
    },
  },
  mounted() {
    this.getcinema();
  },
};
</script>
<style  scoped>
#content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: auto;
}
#content .movie_body {
  flex: 1;
  overflow: auto;
}
#content .cinema_menu {
  width: 100%;
  height: 2.8125rem;
  border-bottom: 0.0625rem solid #e6e6e6;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: white;
}
#content .cinema_body {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.cinema_body ul {
  padding: 0 1.25rem;
}
.cinema_body li {
  border-bottom: 0.0625rem solid #e6e6e6;
  padding-top: 1rem;
}
.cinema_body div {
  margin-bottom: 0.625rem;
}
.cinema_body .q {
  font-size: 0.6875rem;
  color: #f03d37;
}
.cinema_body .price {
  font-size: 1.125rem;
}
.cinema_body .address {
  font-size: 0.8125rem;
  color: #666;
}
.cinema_body .address span:nth-of-type(2) {
  float: right;
}
.cinema_body .card {
  display: flex;
}
.cinema_body .card div {
  padding: 0 0.1875rem;
  height: 0.9375rem;
  line-height: 0.9375rem;
  border-radius: 0.125rem;
  color: #f90;
  border: 0.0625rem solid #f90;
  font-size: 0.8125rem;
  margin-right: 0.3125rem;
}
.cinema_body .card div.or {
  color: #f90;
  border: 0.0625rem solid #f90;
}
.cinema_body .card div.bl {
  color: #589daf;
  border: 0.0625rem solid #589daf;
}
</style>
